package workqueue;

import com.rabbitmq.client.Channel;
import com.rabbitmq.client.Connection;
import utils.RabbitMQUtils;

/**
 * @author lucine
 * @version 1.0 2021/6/18 10:33
 */
public class Provider {

    public static void main(String[] args) throws Exception {
        Connection connection = RabbitMQUtils.getConnection();
        Channel channel = connection.createChannel();

        channel.queueDeclare("work",true,false,false,null);
        for (int i = 0; i < 10; i++) {
            channel.basicPublish("","work",null,(i +"hello workqueue").getBytes());
        }

        RabbitMQUtils.cloneConnectionAndChannel(channel,connection);
    }
}
